# # import akshare as ak
# # df = ak.stock_zh_a_hist("002916", start_date="2025-04-10")
# # print(df)

import requests
import pandas as pd
import json
import matplotlib.pyplot as plt

ret = requests.get('https://jc.zhcw.com/port/client_json.php',params={
        'callback':'jQuery112207181142871857915_1744359992728',
        'transactionType':'10001001',
        'lotteryId':'1',
        'issueCount':'30',
        'startIssue':'',
        'endIssue':'',
        'startDate':'',
        'endDate':'',
        'type':'0',
        'pageNum':'1',
        'pageSize':'30',
        'tt':'0.2418214234078453',
        '_':'1744359992729'
    },headers={
        'Referer':'https://www.zhcw.com/',
        'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0'
    })
json_str = ret.text[ret.text.find('(')+1:ret.text.find(')')]
data = json.loads(json_str)
for item in data['data']:
    item['winnerDetails']=''
df = pd.json_normalize(data['data'])
print(df.to_csv(sep='\t', na_rep='nan'))
